<?php
namespace App\Channels;

use App\Repositories\WechatBroadcast;
use Illuminate\Notifications\Notification;

/**
 * Created by PhpStorm.
 * User: pf
 * Date: 2017/12/20
 * Time: 16:05
 */
class WechatChannel
{

    /**
     * @param $notifiable
     * @param Notification $notification
     */
    public function send($notifiable, Notification $notification){
        $message = $notification->toVoice($notifiable);
        //实例化微信通知类仓库
        $broadcast= new WechatBroadcast();
        $broadcast->sendOne($notifiable->openid,$message['message']);
    }
}